<template>
  <canvas ref="canvas" class="absolute left-0 top-0" />
</template>

<script setup lang="ts">
import { ref, watch } from "vue";
import { ScaleCanvas } from "./ScaleCanvas.ts";

const { config } = defineProps<{
  config: CanvasConfig;
}>();
const canvas = ref<HTMLCanvasElement>();

watch(
  () => config,
  () => {
    new ScaleCanvas(canvas.value!, config).draw();
  },
  { deep: true }
);
</script>

<style></style>
